home *** CD-ROM | disk | FTP | other *** search
- /* This is the source code for the SBCB code resource used by the scroll */
- /* bars in SBar.c. There isn't anything special about the routine, it */
- /* just has to be stored as a code resource so that it can be loaded by */
- /* cdev. */
-
-
- #define DelayTime 9
-
- pascal void main(ControlHandle theControl, int theCode)
- {
- int theCV, maxCV, minCV;
- long dummy;
-
- maxCV = GetCtlMax(theControl);
- theCV = GetCtlValue(theControl);
- minCV = GetCtlMin(theControl);
-
- switch(theCode)
- {
- case inPageDown:
- case inDownButton:
- if (theCV < maxCV)
- {
- theCV += 1;
- Delay(DelayTime, &dummy);
- }
- break;
- case inPageUp:
- case inUpButton:
- if (theCV > minCV)
- {
- theCV -= 1;
- Delay(DelayTime, &dummy);
- }
- }
- SetCtlValue(theControl, theCV);
- }
-